#include <reg52.h>
typedef unsigned char uint8;
typedef unsigned int uint16;

void send_bit(uint8 i)
{
	if(i!=0)TXD=1;
	else TXD=0;
	TR0=1;
	while(!TF0);
	TR0=0;
	TH0=0xFF;
	TL0=0xBD;
	TF0=0;
}

void main()
{
	uint8 a=0xE4;
	uint8 i;
	uint16 j;
	TMOD|=0x01;//1/9600=(65536-x)*12/11059200 
	TMOD&=0xfd;
	TH0=0xff;
	TL0=0xBD;
	TXD=1;
	while(1)
	{
		TF0=0;
		send_bit(0);
		for(i=0;i<8;i++)
		{
			send_bit(a&0x01);
			a=a>>1;
		}
		send_bit(1);
		for(j=0;j<50000;j++);
		a=0xE4;
	}
}